<template>
  <div id="app">
    <header>
      <div class="logo">农产品溯源系统</div>
      <nav>
        <router-link to="/">首页</router-link>
        <router-link to="/products">产品列表</router-link>
        <router-link to="/add-product">添加产品</router-link>
      </nav>
    </header>
    <main>
      <router-view/>
    </main>
    <footer>
      基于区块链的农产品溯源系统 &copy; 2025
    </footer>
  </div>
</template>

<style lang="less">
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #1b1b1b;
  background-color: #fbfcfd;
  line-height: 1.6;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #5473a2;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav {
  display: flex;
  gap: 1.5rem;

  a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    font-weight: bold;

    &::after {
      content: '';
      position: absolute;
      width: 0;
      height: 2px;
      bottom: 0;
      left: 0;
      background-color: white;
      transition: width 0.3s ease;
    }

    &:hover::after,
    &.router-link-active::after {
      width: 100%;
    }

    &.router-link-active {
      color: #e0e0e0;
    }
  }
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

footer {
  background-color: #5473a2;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;

  &-primary {
    background-color: #5473a2;
    color: white;

    &:hover {
      background-color: #77e477;
    }
  }

  &-secondary {
    background-color: #6c757d;
    color: white;

    &:hover {
      background-color: #5a6268;
    }
  }

  &-danger {
    background-color: #dc3545;
    color: white;

    &:hover {
      background-color: #c82333;
    }
  }
}

.card {
  background-color: rgb(43, 169, 228);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(149, 13, 13, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

h1, h2, h3 {
  margin-bottom: 1rem;
  color: #3b7ab9;
}

.form-group {
  margin-bottom: 1.5rem;

  label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
  }

  input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;

    &:focus {
      outline: none;
      border-color: #406cbd;
      box-shadow: 0 0 0 2px rgba(0, 100, 0, 0.1);
    }
  }
}
</style>
